package com.ruoyi.club.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.club.mapper.ClubInfoMapper;
import com.ruoyi.club.domain.ClubInfo;
import com.ruoyi.club.service.IClubInfoService;

/**
 * 社团信息Service业务层处理
 * 
 * @author Zou
 * @date 2025-11-14
 */
@Service
public class ClubInfoServiceImpl implements IClubInfoService 
{
    @Autowired
    private ClubInfoMapper clubInfoMapper;

    /**
     * 查询社团信息
     * 
     * @param id 社团信息主键
     * @return 社团信息
     */
    @Override
    public ClubInfo selectClubInfoById(Long id)
    {
        return clubInfoMapper.selectClubInfoById(id);
    }

    /**
     * 查询社团信息列表
     * 
     * @param clubInfo 社团信息
     * @return 社团信息
     */
    @Override
    public List<ClubInfo> selectClubInfoList(ClubInfo clubInfo)
    {
        return clubInfoMapper.selectClubInfoList(clubInfo);
    }

    /**
     * 新增社团信息
     * 
     * @param clubInfo 社团信息
     * @return 结果
     */
    @Override
    public int insertClubInfo(ClubInfo clubInfo)
    {
        clubInfo.setCreateTime(DateUtils.getNowDate());
        return clubInfoMapper.insertClubInfo(clubInfo);
    }

    /**
     * 修改社团信息
     * 
     * @param clubInfo 社团信息
     * @return 结果
     */
    @Override
    public int updateClubInfo(ClubInfo clubInfo)
    {
        clubInfo.setUpdateTime(DateUtils.getNowDate());
        return clubInfoMapper.updateClubInfo(clubInfo);
    }

    /**
     * 批量删除社团信息
     * 
     * @param ids 需要删除的社团信息主键
     * @return 结果
     */
    @Override
    public int deleteClubInfoByIds(Long[] ids)
    {
        return clubInfoMapper.deleteClubInfoByIds(ids);
    }

    /**
     * 删除社团信息信息
     * 
     * @param id 社团信息主键
     * @return 结果
     */
    @Override
    public int deleteClubInfoById(Long id)
    {
        return clubInfoMapper.deleteClubInfoById(id);
    }
}
